package com.example.springbootdemo.rpc;

import org.springframework.stereotype.Component;

import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

@Component
public class CacheGateway {
    private Map<String, String> cache = new ConcurrentHashMap<>();
    public String getString(String key) {
        return cache.get(key);
    }

    public boolean isBlack(String key) {
        return cache.get("black." +key) != null;
    }
}
